{extend name="admin@public/base_content" /}
{block name="body">}
<body>
{include file="admin@public/common" /}
<div class="layui-form">
    <table class="layui-table lay-even">
        <thead>
        <tr>
            <th width="80">ID</th>
            <th>活动名称</th>
            <th>图片</th>
            <!--<th>活动介绍</th>-->
            <!--<th>分类</th>-->
            <th>类型</th>
            <th>开始时间</th>
            <th>结束时间</th>
            <th>名额</th>
            <th>活动二维码</th>
            <th>浏览次数</th>
            <th>报名人数</th>
            <th>状态</th>
            <th width="240">操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach name="list" item="vo"}
        <tr>
            <td>{$vo.activity_id}</td>
            <td>{$vo.title}</td>
            <td><img src="{$vo.imgurl}" width="50px" height="40px"/></td>
            <!--<td>{$vo.content}</td>-->
            <!--<td>{$vo.cate_id}</td>-->
            <td>{if $vo.type_id ==1 }未成年人{elseif $vo.type_id ==2}成年人{else}家庭{/if}</td>
            <td>{$vo.starttime}</td>
            <td>{$vo.endtime}</td>
            <td>{$vo.signnum}</td>
            <td><a href="{$vo['qrcode']}" download="erweima{$vo.activity_id}">下载</a></td>
            <td>{$vo.clicknum}</td>
            <td>{$vo.bm_num|default="0"} / <a href="{:url('admin/sign/index',array('id'=>$vo['activity_id']))}" class="layui-btn layui-btn-mini modal-catch">
                    查看报名
                </a></td>
            <td>
			{if $vo.status == 3}
			活动已结束
			{else}
			<input type="checkbox" name="field_value" lay-skin="switch" value="1" lay-text="正常|禁用" {eq name="vo.status" value="1"}checked{/eq}  lay-filter="ajax" data-params='{"url":"{:url("api/api/upField")}","confirm":"true","data":"table=activity&id_name=activity_id&id_value={$vo.activity_id}&field=status","complete":"up"}'></td>
            {/if}
			<td>
                <a href="{:url('info',array('activity_id'=>$vo['activity_id']))}" class="layui-btn layui-btn-mini modal-catch">
                    <i class="iconfont">&#xe653;</i>编辑
                </a>
                <a class="layui-btn layui-btn-mini layui-btn-danger ajax"
                   data-list='{"key":"id={$vo.activity_id}","msg":true,"render":"true","action":"del"}'
                   data-params='{"url": "{:url("del")}","confirm":"true","data":"id={$vo.activity_id}","complete":"del"}'>
                    <i class="iconfont">&#xe626;</i>删除
                </a>

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
</div>
<div class="text-right">
    <div class="layui-box layui-laypage layui-laypage-molv" id="layui-laypage-1">
        {$_page}
    </div>
</div>
</body>
{/block}
{block name="script"}
<script>
    layui.use('default');
</script>
{/block}